/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.googlecode.javalearningproject.VEK_ME.XML;

import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import com.googlecode.javalearningproject.VEK_ME.XML.ParsedObjects.ParsedObject;
import com.googlecode.javalearningproject.VEK_ME.XML.ParsedObjects.ParsedMap;

/**
 *
 * @author Administrator
 */
/*

public class XMLParser_MapParser extends DefaultHandler implements ContentHandler {
    
    private String tempElementData;
    private ParsedMap parsedMap;
            
    private String location;
    private String backgroundFilename;
    private int widthOfBackground;
    private int heightOfBackground;
    
    
    
    public XMLParser_MapParser()
    {
        //super();
        
    }

    @Override
    public void setDocumentLocator(Locator locator) {
        
    }

    @Override
    public void startDocument() throws SAXException {
    }

    @Override
    public void endDocument() throws SAXException {
        parsedMap = new ParsedMap(location, backgroundFilename, widthOfBackground, heightOfBackground);
    }

    @Override
    public void startPrefixMapping(String prefix, String uri) throws SAXException {
        
    }

    @Override
    public void endPrefixMapping(String prefix) throws SAXException {
        
    }

    @Override
    public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
        
    }

    @Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
        if(localName.equals("location"))
        {
            location = tempElementData;
        }
        
        else if(localName.equals("backgroundFilename"))
        {
            backgroundFilename = tempElementData;
        }
        
        else if(localName.equals("widthOfBackground"))
        {
            widthOfBackground = Integer.valueOf( tempElementData );
        }
        
        else if(localName.equals("heightOfBackground"))
        {
            heightOfBackground  = Integer.valueOf( tempElementData );
        }
        
        
        
    }

    @Override
    public void characters(char[] ch, int start, int length) throws SAXException {
        
       tempElementData = new String(ch, start, length);
        
    }

    @Override
    public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
        
    }

    @Override
    public void processingInstruction(String target, String data) throws SAXException {
        
    }

    @Override
    public void skippedEntity(String name) throws SAXException {
        
    }
    
    public ParsedObject getParsedObject()
    {
        return parsedMap;
    }
    
    public ParsedMap getParsedMap()
    {
        return parsedMap;
    }
    
    

}
 * */
